3.776 \(\int \sec (c+d x) (a+b \sec (c+d x))^2 (B \sec (c+d x)+C \sec ^2(c+d x)) \, dx\)

Optimal. Leaf size=179 \[ \frac{\left (4 a^2 b B+a^3 (-C)+8 a b^2 C+4 b^3 B\right ) \tan (c+d x)}{6 b d}+\frac{\left (4 a^2 C+8 a b B+3 b^2 C\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac{\left (-2 a^2 C+8 a b B+9 b^2 C\right ) \tan (c+d x) \sec (c+d x)}{24 d}+\frac{(4 b B-a C) \tan (c+d x) (a+b \sec (c+d x))^2}{12 b d}+\frac{C \tan (c+d x) (a+b \sec (c+d x))^3}{4 b d} \]

[Out]

((8*a*b*B + 4*a^2*C + 3*b^2*C)*ArcTanh[Sin[c + d*x]])/(8*d) + ((4*a^2*b*B + 4*b^3*B - a^3*C + 8*a*b^2*C)*Tan[c
 + d*x])/(6*b*d) + ((8*a*b*B - 2*a^2*C + 9*b^2*C)*Sec[c + d*x]*Tan[c + d*x])/(24*d) + ((4*b*B - a*C)*(a + b*Se
c[c + d*x])^2*Tan[c + d*x])/(12*b*d) + (C*(a + b*Sec[c + d*x])^3*Tan[c + d*x])/(4*b*d)

________________________________________________________________________________________

Rubi [A]  time = 0.347556, antiderivative size = 179, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 8, integrand size = 38, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.21, Rules used = {4072, 4010, 4002, 3997, 3787, 3770, 3767, 8} \[ \frac{\left (4 a^2 b B+a^3 (-C)+8 a b^2 C+4 b^3 B\right ) \tan (c+d x)}{6 b d}+\frac{\left (4 a^2 C+8 a b B+3 b^2 C\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac{\left (-2 a^2 C+8 a b B+9 b^2 C\right ) \tan (c+d x) \sec (c+d x)}{24 d}+\frac{(4 b B-a C) \tan (c+d x) (a+b \sec (c+d x))^2}{12 b d}+\frac{C \tan (c+d x) (a+b \sec (c+d x))^3}{4 b d} \]

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]*(a + b*Sec[c + d*x])^2*(B*Sec[c + d*x] + C*Sec[c + d*x]^2),x]

[Out]

((8*a*b*B + 4*a^2*C + 3*b^2*C)*ArcTanh[Sin[c + d*x]])/(8*d) + ((4*a^2*b*B + 4*b^3*B - a^3*C + 8*a*b^2*C)*Tan[c
 + d*x])/(6*b*d) + ((8*a*b*B - 2*a^2*C + 9*b^2*C)*Sec[c + d*x]*Tan[c + d*x])/(24*d) + ((4*b*B - a*C)*(a + b*Se
c[c + d*x])^2*Tan[c + d*x])/(12*b*d) + (C*(a + b*Sec[c + d*x])^3*Tan[c + d*x])/(4*b*d)

Rule 4072

Int[((a_.) + csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(
x_)]^2*(C_.))*((c_.) + csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.), x_Symbol] :> Dist[1/b^2, Int[(a + b*Csc[e + f*x])
^(m + 1)*(c + d*Csc[e + f*x])^n*(b*B - a*C + b*C*Csc[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C, m,
 n}, x] && EqQ[A*b^2 - a*b*B + a^2*C, 0]

Rule 4010

Int[csc[(e_.) + (f_.)*(x_)]^2*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_
)), x_Symbol] :> -Simp[(B*Cot[e + f*x]*(a + b*Csc[e + f*x])^(m + 1))/(b*f*(m + 2)), x] + Dist[1/(b*(m + 2)), I
nt[Csc[e + f*x]*(a + b*Csc[e + f*x])^m*Simp[b*B*(m + 1) + (A*b*(m + 2) - a*B)*Csc[e + f*x], x], x], x] /; Free
Q[{a, b, e, f, A, B, m}, x] && NeQ[A*b - a*B, 0] &&  !LtQ[m, -1]

Rule 4002

Int[csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_))
, x_Symbol] :> -Simp[(B*Cot[e + f*x]*(a + b*Csc[e + f*x])^m)/(f*(m + 1)), x] + Dist[1/(m + 1), Int[Csc[e + f*x
]*(a + b*Csc[e + f*x])^(m - 1)*Simp[b*B*m + a*A*(m + 1) + (a*B*m + A*b*(m + 1))*Csc[e + f*x], x], x], x] /; Fr
eeQ[{a, b, A, B, e, f}, x] && NeQ[A*b - a*B, 0] && NeQ[a^2 - b^2, 0] && GtQ[m, 0]

Rule 3997

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))*(csc[(e_.) + (f_.)*(x_)]*(B_.
) + (A_)), x_Symbol] :> -Simp[(b*B*Cot[e + f*x]*(d*Csc[e + f*x])^n)/(f*(n + 1)), x] + Dist[1/(n + 1), Int[(d*C
sc[e + f*x])^n*Simp[A*a*(n + 1) + B*b*n + (A*b + B*a)*(n + 1)*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, d, e, f
, A, B}, x] && NeQ[A*b - a*B, 0] &&  !LeQ[n, -1]

Rule 3787

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[a, Int[(d*
Csc[e + f*x])^n, x], x] + Dist[b/d, Int[(d*Csc[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, n}, x]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \sec (c+d x) (a+b \sec (c+d x))^2 \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\int \sec ^2(c+d x) (a+b \sec (c+d x))^2 (B+C \sec (c+d x)) \, dx\\ &=\frac{C (a+b \sec (c+d x))^3 \tan (c+d x)}{4 b d}+\frac{\int \sec (c+d x) (a+b \sec (c+d x))^2 (3 b C+(4 b B-a C) \sec (c+d x)) \, dx}{4 b}\\ &=\frac{(4 b B-a C) (a+b \sec (c+d x))^2 \tan (c+d x)}{12 b d}+\frac{C (a+b \sec (c+d x))^3 \tan (c+d x)}{4 b d}+\frac{\int \sec (c+d x) (a+b \sec (c+d x)) \left (b (8 b B+7 a C)+\left (8 a b B-2 a^2 C+9 b^2 C\right ) \sec (c+d x)\right ) \, dx}{12 b}\\ &=\frac{\left (8 a b B-2 a^2 C+9 b^2 C\right ) \sec (c+d x) \tan (c+d x)}{24 d}+\frac{(4 b B-a C) (a+b \sec (c+d x))^2 \tan (c+d x)}{12 b d}+\frac{C (a+b \sec (c+d x))^3 \tan (c+d x)}{4 b d}+\frac{\int \sec (c+d x) \left (3 b \left (8 a b B+4 a^2 C+3 b^2 C\right )+4 \left (4 a^2 b B+4 b^3 B-a^3 C+8 a b^2 C\right ) \sec (c+d x)\right ) \, dx}{24 b}\\ &=\frac{\left (8 a b B-2 a^2 C+9 b^2 C\right ) \sec (c+d x) \tan (c+d x)}{24 d}+\frac{(4 b B-a C) (a+b \sec (c+d x))^2 \tan (c+d x)}{12 b d}+\frac{C (a+b \sec (c+d x))^3 \tan (c+d x)}{4 b d}+\frac{1}{8} \left (8 a b B+4 a^2 C+3 b^2 C\right ) \int \sec (c+d x) \, dx+\frac{\left (4 a^2 b B+4 b^3 B-a^3 C+8 a b^2 C\right ) \int \sec ^2(c+d x) \, dx}{6 b}\\ &=\frac{\left (8 a b B+4 a^2 C+3 b^2 C\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac{\left (8 a b B-2 a^2 C+9 b^2 C\right ) \sec (c+d x) \tan (c+d x)}{24 d}+\frac{(4 b B-a C) (a+b \sec (c+d x))^2 \tan (c+d x)}{12 b d}+\frac{C (a+b \sec (c+d x))^3 \tan (c+d x)}{4 b d}-\frac{\left (4 a^2 b B+4 b^3 B-a^3 C+8 a b^2 C\right ) \operatorname{Subst}(\int 1 \, dx,x,-\tan (c+d x))}{6 b d}\\ &=\frac{\left (8 a b B+4 a^2 C+3 b^2 C\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac{\left (4 a^2 b B+4 b^3 B-a^3 C+8 a b^2 C\right ) \tan (c+d x)}{6 b d}+\frac{\left (8 a b B-2 a^2 C+9 b^2 C\right ) \sec (c+d x) \tan (c+d x)}{24 d}+\frac{(4 b B-a C) (a+b \sec (c+d x))^2 \tan (c+d x)}{12 b d}+\frac{C (a+b \sec (c+d x))^3 \tan (c+d x)}{4 b d}\\ \end{align*}

Mathematica [A]  time = 0.761261, size = 120, normalized size = 0.67 \[ \frac{3 \left (4 a^2 C+8 a b B+3 b^2 C\right ) \tanh ^{-1}(\sin (c+d x))+\tan (c+d x) \left (3 \left (4 a^2 C+8 a b B+3 b^2 C\right ) \sec (c+d x)+24 \left (a^2 B+2 a b C+b^2 B\right )+8 b (2 a C+b B) \tan ^2(c+d x)+6 b^2 C \sec ^3(c+d x)\right )}{24 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]*(a + b*Sec[c + d*x])^2*(B*Sec[c + d*x] + C*Sec[c + d*x]^2),x]

[Out]

(3*(8*a*b*B + 4*a^2*C + 3*b^2*C)*ArcTanh[Sin[c + d*x]] + Tan[c + d*x]*(24*(a^2*B + b^2*B + 2*a*b*C) + 3*(8*a*b
*B + 4*a^2*C + 3*b^2*C)*Sec[c + d*x] + 6*b^2*C*Sec[c + d*x]^3 + 8*b*(b*B + 2*a*C)*Tan[c + d*x]^2))/(24*d)

________________________________________________________________________________________

Maple [A]  time = 0.037, size = 241, normalized size = 1.4 \begin{align*}{\frac{B{a}^{2}\tan \left ( dx+c \right ) }{d}}+{\frac{{a}^{2}C\sec \left ( dx+c \right ) \tan \left ( dx+c \right ) }{2\,d}}+{\frac{{a}^{2}C\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{2\,d}}+{\frac{Bab\sec \left ( dx+c \right ) \tan \left ( dx+c \right ) }{d}}+{\frac{Bab\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{d}}+{\frac{4\,abC\tan \left ( dx+c \right ) }{3\,d}}+{\frac{2\,abC\tan \left ( dx+c \right ) \left ( \sec \left ( dx+c \right ) \right ) ^{2}}{3\,d}}+{\frac{2\,B{b}^{2}\tan \left ( dx+c \right ) }{3\,d}}+{\frac{B{b}^{2}\tan \left ( dx+c \right ) \left ( \sec \left ( dx+c \right ) \right ) ^{2}}{3\,d}}+{\frac{{b}^{2}C\tan \left ( dx+c \right ) \left ( \sec \left ( dx+c \right ) \right ) ^{3}}{4\,d}}+{\frac{3\,{b}^{2}C\sec \left ( dx+c \right ) \tan \left ( dx+c \right ) }{8\,d}}+{\frac{3\,{b}^{2}C\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{8\,d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)*(a+b*sec(d*x+c))^2*(B*sec(d*x+c)+C*sec(d*x+c)^2),x)

[Out]

1/d*B*a^2*tan(d*x+c)+1/2/d*a^2*C*sec(d*x+c)*tan(d*x+c)+1/2/d*a^2*C*ln(sec(d*x+c)+tan(d*x+c))+1/d*B*a*b*sec(d*x
+c)*tan(d*x+c)+1/d*B*a*b*ln(sec(d*x+c)+tan(d*x+c))+4/3/d*a*b*C*tan(d*x+c)+2/3/d*a*b*C*tan(d*x+c)*sec(d*x+c)^2+
2/3/d*B*b^2*tan(d*x+c)+1/3/d*B*b^2*tan(d*x+c)*sec(d*x+c)^2+1/4/d*b^2*C*tan(d*x+c)*sec(d*x+c)^3+3/8/d*b^2*C*sec
(d*x+c)*tan(d*x+c)+3/8/d*b^2*C*ln(sec(d*x+c)+tan(d*x+c))

________________________________________________________________________________________

Maxima [A]  time = 0.977326, size = 308, normalized size = 1.72 \begin{align*} \frac{32 \,{\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} C a b + 16 \,{\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} B b^{2} - 3 \, C b^{2}{\left (\frac{2 \,{\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 12 \, C a^{2}{\left (\frac{2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 24 \, B a b{\left (\frac{2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 48 \, B a^{2} \tan \left (d x + c\right )}{48 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+b*sec(d*x+c))^2*(B*sec(d*x+c)+C*sec(d*x+c)^2),x, algorithm="maxima")

[Out]

1/48*(32*(tan(d*x + c)^3 + 3*tan(d*x + c))*C*a*b + 16*(tan(d*x + c)^3 + 3*tan(d*x + c))*B*b^2 - 3*C*b^2*(2*(3*
sin(d*x + c)^3 - 5*sin(d*x + c))/(sin(d*x + c)^4 - 2*sin(d*x + c)^2 + 1) - 3*log(sin(d*x + c) + 1) + 3*log(sin
(d*x + c) - 1)) - 12*C*a^2*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) - log(sin(d*x + c) + 1) + log(sin(d*x + c) - 1
)) - 24*B*a*b*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) - log(sin(d*x + c) + 1) + log(sin(d*x + c) - 1)) + 48*B*a^2
*tan(d*x + c))/d

________________________________________________________________________________________

Fricas [A]  time = 0.534846, size = 443, normalized size = 2.47 \begin{align*} \frac{3 \,{\left (4 \, C a^{2} + 8 \, B a b + 3 \, C b^{2}\right )} \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \,{\left (4 \, C a^{2} + 8 \, B a b + 3 \, C b^{2}\right )} \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \,{\left (8 \,{\left (3 \, B a^{2} + 4 \, C a b + 2 \, B b^{2}\right )} \cos \left (d x + c\right )^{3} + 6 \, C b^{2} + 3 \,{\left (4 \, C a^{2} + 8 \, B a b + 3 \, C b^{2}\right )} \cos \left (d x + c\right )^{2} + 8 \,{\left (2 \, C a b + B b^{2}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{48 \, d \cos \left (d x + c\right )^{4}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+b*sec(d*x+c))^2*(B*sec(d*x+c)+C*sec(d*x+c)^2),x, algorithm="fricas")

[Out]

1/48*(3*(4*C*a^2 + 8*B*a*b + 3*C*b^2)*cos(d*x + c)^4*log(sin(d*x + c) + 1) - 3*(4*C*a^2 + 8*B*a*b + 3*C*b^2)*c
os(d*x + c)^4*log(-sin(d*x + c) + 1) + 2*(8*(3*B*a^2 + 4*C*a*b + 2*B*b^2)*cos(d*x + c)^3 + 6*C*b^2 + 3*(4*C*a^
2 + 8*B*a*b + 3*C*b^2)*cos(d*x + c)^2 + 8*(2*C*a*b + B*b^2)*cos(d*x + c))*sin(d*x + c))/(d*cos(d*x + c)^4)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (B + C \sec{\left (c + d x \right )}\right ) \left (a + b \sec{\left (c + d x \right )}\right )^{2} \sec ^{2}{\left (c + d x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+b*sec(d*x+c))**2*(B*sec(d*x+c)+C*sec(d*x+c)**2),x)

[Out]

Integral((B + C*sec(c + d*x))*(a + b*sec(c + d*x))**2*sec(c + d*x)**2, x)

________________________________________________________________________________________

Giac [B]  time = 1.42798, size = 645, normalized size = 3.6 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+b*sec(d*x+c))^2*(B*sec(d*x+c)+C*sec(d*x+c)^2),x, algorithm="giac")

[Out]

1/24*(3*(4*C*a^2 + 8*B*a*b + 3*C*b^2)*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 3*(4*C*a^2 + 8*B*a*b + 3*C*b^2)*log
(abs(tan(1/2*d*x + 1/2*c) - 1)) - 2*(24*B*a^2*tan(1/2*d*x + 1/2*c)^7 - 12*C*a^2*tan(1/2*d*x + 1/2*c)^7 - 24*B*
a*b*tan(1/2*d*x + 1/2*c)^7 + 48*C*a*b*tan(1/2*d*x + 1/2*c)^7 + 24*B*b^2*tan(1/2*d*x + 1/2*c)^7 - 15*C*b^2*tan(
1/2*d*x + 1/2*c)^7 - 72*B*a^2*tan(1/2*d*x + 1/2*c)^5 + 12*C*a^2*tan(1/2*d*x + 1/2*c)^5 + 24*B*a*b*tan(1/2*d*x
+ 1/2*c)^5 - 80*C*a*b*tan(1/2*d*x + 1/2*c)^5 - 40*B*b^2*tan(1/2*d*x + 1/2*c)^5 - 9*C*b^2*tan(1/2*d*x + 1/2*c)^
5 + 72*B*a^2*tan(1/2*d*x + 1/2*c)^3 + 12*C*a^2*tan(1/2*d*x + 1/2*c)^3 + 24*B*a*b*tan(1/2*d*x + 1/2*c)^3 + 80*C
*a*b*tan(1/2*d*x + 1/2*c)^3 + 40*B*b^2*tan(1/2*d*x + 1/2*c)^3 - 9*C*b^2*tan(1/2*d*x + 1/2*c)^3 - 24*B*a^2*tan(
1/2*d*x + 1/2*c) - 12*C*a^2*tan(1/2*d*x + 1/2*c) - 24*B*a*b*tan(1/2*d*x + 1/2*c) - 48*C*a*b*tan(1/2*d*x + 1/2*
c) - 24*B*b^2*tan(1/2*d*x + 1/2*c) - 15*C*b^2*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 - 1)^4)/d